package com.fzdy.dataplatform.entity;

import lombok.NoArgsConstructor;

import javax.persistence.*;

@Entity
@Table(name = "user_ktv_business")
@NoArgsConstructor
public class UserKtvBusiness {
    private Integer id;
    private Integer businessid;
    private Integer ktvgroupid;
    private String memo;

    private Business business;
    private KTVGroup ktvGroup;

    public UserKtvBusiness(Integer businessid, Integer ktvgroupid, String memo) {
        this.businessid = businessid;
        this.ktvgroupid = ktvgroupid;
        this.memo = memo;
    }

    public UserKtvBusiness(Integer businessid) {
        this.businessid = businessid;
    }

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Column(name = "businessid")
    public Integer getBusinessid() {
        return businessid;
    }

    public void setBusinessid(Integer businessid) {
        this.businessid = businessid;
    }

    @Column(name = "ktvgroupid")
    public Integer getKtvgroupid() {
        return ktvgroupid;
    }

    public void setKtvgroupid(Integer ktvgroupid) {
        this.ktvgroupid = ktvgroupid;
    }

    @Column(name = "memo")
    public String getMemo() {
        return memo;
    }

    public void setMemo(String memo) {
        this.memo = memo;
    }

    @ManyToOne
    @JoinColumn(name = "businessid", referencedColumnName = "id", foreignKey = @ForeignKey(name = "user_ktv_business_ibfk_1"), insertable = false, updatable = false)
    public Business getBusiness() {
        return business;
    }

    public void setBusiness(Business business) {
        this.business = business;
    }

    @ManyToOne
    @JoinColumn(name = "ktvgroupid", referencedColumnName = "id", foreignKey = @ForeignKey(name = "user_ktv_business_ibfk_2"), insertable = false, updatable = false)
    public KTVGroup getKtvGroup() {
        return ktvGroup;
    }

    public void setKtvGroup(KTVGroup ktvGroup) {
        this.ktvGroup = ktvGroup;
    }
}
